<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>评价</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="/static/user/css/font-awesome.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/basic.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/dingdan.css"/>
	<link href="/static/mobile/css/mui.min.css" rel="stylesheet"/>
	<link href="/static/plugins/layui/css/layui.css" rel="stylesheet"  media="all" >
	<script type="text/javascript" src="/static/mobile/js/jquery.js"></script>

    <style>
	    *{
			margin: 0px;
			padding: 0px;
		}
		::-webkit-scrollbar{
		  display:none;
		}
		.header{
			height: 44px;
		}
		header h1{
			font-size: 18px;

		}
		header a{
			color:#000000;
			font-size: 18px;
		}
		.mui-bar h1{
			font-weight: bold;
		}
		.mui-bar{
			background: #fff;
			box-shadow: none;
			border-bottom: 1px solid #ccc;
		}
		.container{
			padding: 0px 10px;
		}
		::-webkit-input-placeholder
		{
		    text-align: right;
		}
		:-ms-input-placeholder
		{
		   text-align: right;
		}
		:-moz-placeholder
		{
		  text-align: right;
		}
		::-moz-placeholder
		{
		  text-align: right;
		}
		textarea::-webkit-input-placeholder{
			text-align: left;
		}
		.fabux{
			position: relative;
			top: -15px;
			border-radius: 50%;
			width: 0.6% !important;
			text-align: center;
		}
		.fabux img{
			width: 100%;
		}
		.kong{
			height: 40px;
		}
		.ge{
			height: 5px;
			background: #efeff4;
		}

    	.container-1{
			padding: 0px 15px;
		}
		.aaa-1{
			margin-top: 10px;
			padding: 10px;
			background: #F2F0F0;
			border: 1px solid #ddd;
			border-radius: 5px;
		}
		.aaa-1 textarea{
			font-size: 0.9rem;
			background: #F2F0F0;
			width: 100%;
			resize: none;
			outline: none;
			border: none;
			height: 100px;
		}
		.aaa-2{
			margin-top: 15px;
		}
		.aaa-2 p{
			text-align: center;
			font-size: 1rem;
		}
		.sub {
			margin-top: 20px;
		}
		.sub button{
			width: 100%;
			height: 35px;
			border-radius: 3px;
			border: none;
			background: #007aff;
			color: #fff;
			font-size: 0.95rem;
		}
		body{
			background: #fff;
		}
		.aaa-3{
			margin-top: 15px;
		}
		.aaa-3 .s1{
			color: #000;
			font-size: 0.95rem;
		}
		.aaa-3 .fa{
			font-size: 1.1rem;
			color: #ccc;
		}
		.aaa-3 .fa.select{
			color: #ff7600;
		}

    </style>



</head>
<body>
<div class="sectionx">
	<header class="mui-bar mui-bar-nav" >
		<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #4E4E4E;"></a>
		<h1 class="mui-title">评价</h1>
	</header>
</div>
	<div class="section1">
		<div class="aaa">
			<div class="container-1">
				<div class="layui-form">
					<div class="aaa-1">
						<textarea name="content" rows="5" cols="" placeholder="你想对他说什么？赶快写下来吧！"></textarea>
					</div>
					<div class="aaa-2">
						<form class="layui-form layui-form-pane" lay-filter="form-system">
							<div class="layui-form-item">
								<label class="layui-form-label">宝贝图片</label>
								<input type="hidden" name="logo" id="logo">
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn layui-btn-primary" id="logoBtn"><i class="icon icon-upload3"></i>点击上传</button>
										<div class="layui-upload-list">
											<img class="layui-upload-img" id="cltLogo" style="width: 100%">
											<p id="demoText"></p>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>

					<div class="aaa-2">
						<p>------为他打点分吧------</p>
					</div>
					<div class="aaa-3">
						<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
							<legend>综合评价</legend>
						</fieldset>
						<input type="hidden" id="xing" name="xing" value="5">
						<input type="hidden" id="id" name="id" value="{$id}">
					<!--	<div id="test3"></div>-->
						<div><div id="test4"></div></div>
					</div>
					<div class="sub">
						<button type="button"  lay-filter="sub" lay-submit>评价</button>

					</div>



				</div>
			</div>
		</div>



	</div>


<script src="/static/plugins/layui/layui.all.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
	layui.use(['form', 'layer','upload','element'], function () {
		var form = layui.form,layer = layui.layer,upload = layui.upload,$ = layui.jquery,element = layui.element;
		//普通图片上传
		var uploadInst = upload.render({
			elem: '#logoBtn'
			,url: '{:url("user/UpFiles/upload")}'
			,before: function(obj){
				//预读本地文件示例，不支持ie8
				obj.preview(function(index, file, result){
					$('#cltLogo').attr('src', result); //图片链接（base64）
				});
			}
			,done: function(res){
				//上传成功
				if(res.code>0){
					$('#logo').val(res.url);
				}else{
					//如果上传失败
					return layer.msg('上传失败');
				}
			}
			,error: function(){
				//演示失败状态，并实现重传
				var demoText = $('#demoText');
				demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
				demoText.find('.demo-reload').on('click', function(){
					uploadInst.upload();
				});
			}
		});

		form.on('submit(sub)', function (data) {
			var loading = layer.load(1, {shade: [0.1, '#fff']});
			$.post("{:url('pinglun')}",data.field,function(res){
				layer.close(loading);
				if(res.code > 0){
					layer.msg(res.msg,{time:1000,icon:1},function(){
						location.href = "{:url('user/set/dingdan')}";
					});
				}else{
					layer.msg(res.msg,{time:1000,icon:2});
					$('.captcha img').attr('src','{:url("verify")}?id='+Math.random());
				}
			});
		})
	})
	layui.use(['rate'], function(){
		var rate = layui.rate;
		//半星效果
/*		rate.render({
			elem: '#test3'
			,value: 0 //初始值
			,half: true //开启半星
		})*/
		rate.render({
			elem: '#test4'
			,value: 5
			,half: true
			,text: true
			,choose: function(value){
				$("#xing").val(value);
			}
		})
	});
/*	layui.use(['form', 'layer'], function () {
		var form = layui.form,$ = layui.jquery;*/
		// 登录提交监听

//	})
</script>

</body>

</html>